import { FormSchema } from '/@/components/Table';

export const formSchema: FormSchema[] = [
  {
    field: 'way',
    label: '方式',
    component: 'Input',
    colProps: {
      span: 24,
    },
    slot: 'way',
  },
  {
    field: 'mode',
    label: '操作',
    component: 'RadioGroup',
    colProps: { span: 24 },
    defaultValue: '1',
    componentProps: ({ formModel }) => {
      return {
        options: [
          {
            label: '无',
            value: '0',
          },
          {
            label: '提醒人员',
            value: '1',
          },
          {
            label: '抄送流程',
            value: '2',
          },
        ],
        onChange: (e) => {
          console.log('value', formModel);
          // formModel['yearNum'] = e.target.value;
        },
      };
    },
  },
  {
    field: 'actionNames',
    label: '节点',
    component: 'Input',
    colProps: {
      span: 24,
    },
    ifShow: ({ values }) => values.mode == '1',
    slot: 'actionNames',
  },
  {
    field: 'deptFields',
    label: '部门字段',
    component: 'Input',
    colProps: {
      span: 24,
    },
    ifShow: ({ values }) => values.mode != '0',
    slot: 'deptFields',
  },
  {
    field: 'userFields',
    label: '用户字段',
    component: 'Input',
    colProps: {
      span: 24,
    },
    ifShow: ({ values }) => values.mode != '0',
    slot: 'userFields',
  },
  {
    field: 'roleDescs',
    label: '角色',
    // helpMessage: '',
    component: 'Input',
    colProps: {
      span: 24,
    },
    ifShow: ({ values }) => values.mode != '0',
    slot: 'roleDescs',
  },
  {
    field: 'userRealNames',
    label: '用户',
    component: 'Input',
    colProps: {
      span: 24,
    },
    ifShow: ({ values }) => values.mode != '0',
    slot: 'userRealNames',
  },
  {
    field: 'title',
    label: '标题',
    required: true,
    component: 'Input',
    colProps: {
      span: 24,
    },
    slot: 'title',
    ifShow: ({ values }) => values.mode == '1',
  },
  // {
  //   field: 'titleFields',
  //   label: '插入字段',
  //   component: 'Select',
  //   colProps: {
  //     span: 12,
  //   },
  //   componentProps: ({ formModel }) => {
  //     return {
  //       options: [],
  //     };
  //   },
  //   ifShow: ({ values }) => values.mode == '1',
  // },
  {
    field: 'content',
    label: '内容',
    required: true,
    component: 'InputTextArea',
    colProps: {
      span: 24,
    },
    slot: 'content',
    ifShow: ({ values }) => values.mode == '1',
  },
  // {
  //   field: 'contentFields',
  //   label: '插入字段',
  //   component: 'Select',
  //   colProps: {
  //     span: 12,
  //   },
  //   componentProps: ({ formModel }) => {
  //     return {
  //       options: [],
  //     };
  //   },
  //   ifShow: ({ values }) => values.mode == '1',
  // },
  {
    field: 'flow',
    label: '流程',
    component: 'Input',
    colProps: {
      span: 24,
    },
    slot: 'flow',
    ifShow: ({ values }) => values.mode == '1',
  },
];
